package com.nabi.starter.common.exception;

/**
 * @author CAOYOU
 * @Title: Error
 * @date 2019/10/1714:11
 */
public interface ApiErrorCode {
    // 1000  到  -999  前端需要显示
    // -1000  到  -1999  本服务的接口异常，比如：方法报错
    // -2000  到  -2999  通过Fegin调用的异常
    // -3000  到  -3999  第三方接口详细异常
    // -4000  到  -4999  数据库详细异常
    // -5000  到  -5999  Activiti详细异常
    // -6000  到  -6999  JSON、XML、文件操作异常
    // -6000  到  -9999  业务详细异常,比如：认证失败
    // -10000  到  -99999  参数详细异常，比如：非空异常等
    public static final ApiCode OK = new ApiCode(0, "操作成功");
    public static final ApiCode BUSINESS_ERR = new ApiCode(-1, "业务异常");
    public static final ApiCode OPERATION_FAILURE = new ApiCode(-1, "操作失败");
    public static final ApiCode PARAM_ERROR = new ApiCode(-2, "参数错误");
    public static final ApiCode NOT_PERMISSION = new ApiCode(-3, "没有权限");
    public static final ApiCode TOKEN_INVALID = new ApiCode(-4, "无效token");
    public static final ApiCode LOGIN_FAILED = new ApiCode(-5, "登录失败");
    public static final ApiCode TOKEN_LOGIN_INVALID = new ApiCode(-6, "会话超时，请重新登录");
    public static final ApiCode REQUEST_TIME_OUT = new ApiCode(-7, "请求超时");
    public static final ApiCode DATA_EXCEPTION = new ApiCode(-8, "数据异常");
    public static final ApiCode SYSTEM_ERR = new ApiCode(-99, "系统繁忙，请稍候再试");
    public static final ApiCode NETWORK_ERR = new ApiCode(-98, "网络繁忙，请稍候再试");

    public static final ApiCode INTERNAL_ERROR = new ApiCode(-1000, "内部异常");

    public static final ApiCode API_ERROR = new ApiCode(-2000, "Fegin内部调用异常");
    public static final ApiCode INTERNAL_ERR_GENERATE = new ApiCode(-2001, "文书生成失败");
    public static final ApiCode INTERNAL_ERR_CLASS_INIT = new ApiCode(-2002, "类初始化失败");
    public static final ApiCode INTERNAL_ERR_CLASS_INVALID = new ApiCode(-2003, "类无效");


    public static final ApiCode OTHER_API_ERR = new ApiCode(-3000, "第三方接口异常");
    public static final ApiCode OTHER_API_ERR_EMAIL_SEND = new ApiCode(-3001, "邮件发送失败");
    public static final ApiCode OTHER_API_ERR_SMS_SEND = new ApiCode(-3002, "短信发送失败");
    public static final ApiCode OTHER_API_ERR_INMAIL_SEND = new ApiCode(-3003, "站内信发送失败");


    public static final ApiCode DB_ERROR = new ApiCode(-4000, "操作数据异常");
    public static final ApiCode DB_DATA_EXIST = new ApiCode(-4001, "该记录已存在");
    public static final ApiCode DB_DATA_NOT_EXIST = new ApiCode(-4002, "该记录不存在");

    public static final ApiCode AUDIT_ERR = new ApiCode(-5000, "流程异常");
    public static final ApiCode AUDIT_NOT_EXIST = new ApiCode(-5001, "流程任务不存在");
    public static final ApiCode AUDIT_ILLEGAL_OPERATION = new ApiCode(-5002, "非法操作");

    public static final ApiCode FILE_OPERATE_ERR = new ApiCode(-6000, "JSON、XML、文档转换异常");
    public static final ApiCode FILE_OPERATE_JSON = new ApiCode(-6001, "JSON解析失败");
    public static final ApiCode FILE_OPERATE_XML = new ApiCode(-6002, "XML解析失败");
    public static final ApiCode FILE_OPERATE_TEMPLATE_TRANSITION = new ApiCode(-6003, "模板转换失败");
    public static final ApiCode FILE_OPERATE_SEARCH_KEY = new ApiCode(-6004, "读取文书关键字异常");
    public static final ApiCode FILE_OPERATE_FLIE_MAX = new ApiCode(-6005, "文件过大");
    public static final ApiCode FILE_OPERATE_NOT_EXIST = new ApiCode(-6006, "文件不存在");
    public static final ApiCode FILE_OPERATE_EXIST = new ApiCode(-6006, "文件已存在");
    public static final ApiCode FILE_OPERATE_CONVERT = new ApiCode(-6006, "文件转换失败");
    public static final ApiCode FILE_OPERATE_UPLOADING = new ApiCode(-6007, "上传文件失败");
    //以下用于类案接口返回状态码
    public static final ApiCode USER_NOT_FIND = new ApiCode(70000, "用户不存在");
    public static final ApiCode USER_NOT_BUSINESS_ACCOUNT = new ApiCode(70010, "账户不是企业账户，不具备立案申请权限");
    public static final ApiCode USER_PASSWORD_WRONG = new ApiCode(70020, "用户密码错误");
    public static final ApiCode ACCOUNT_HAD_LOCKED = new ApiCode(70030, "账户已锁定");
    public static final ApiCode ACCOUNT_NO_CERTIFICATION = new ApiCode(70040, "账户没有通过实名认证");
    public static final ApiCode LOGIN_SUCCESS = new ApiCode(200, "登录成功");

}
